#pragma once

#include <memory>
#include <thread>
#include <vector>
#include "EventLoopThread.h"

class EventLoop;

class LoopThreadPool {
public:
    LoopThreadPool(EventLoop* main_thread);

    void SetThreadNum(const int num);

    void start();

    EventLoop* GetNextLoop();

private:
    int thread_num_;  // 从属线程数量
    EventLoop* base_loop_;
    std::vector<std::unique_ptr<EventLoopThread>> threads_;
    std::vector<EventLoop*> loops_;
    int next_;
};
